#ifndef _OPCOL_UTIL_H_
#define _OPCOL_UTIL_H_

int OPCOL_Byte_index_of(char *buf,int len, char *s);
int OPCOL_String_index_of(char *buf,int len, char *s);
void OPCOL_char_array_to_hex(unsigned char *src,int src_len,char *dest);
int OPCOL_hex_to_char_array(char *hexstring,unsigned char *d);

/*
查找buffer中是否有特定的数据片段
*/
int OPCOL_data_piece_pop(
    char *buffer,int buffer_len,
    int *piece_start_index,int crc_len,int crc_type,
    char *data_head_mark,char *data_end_mark);

void SSB_sha1(unsigned char * data, int size, unsigned char hash[20]);

#endif
